The Add
method is a member of the Editor.HistoryStack<T>
class. It is used to add an item of type T
to the history stack. This method is essential for maintaining a record of changes or states that can be navigated through using the history stack's navigation methods.
To use the Add
method, you need to have an instance of HistoryStack<T>
. You can then call the Add
method on this instance, passing the item you want to add to the history stack as a parameter.
Example usage:
var historyStack = new HistoryStack<string>();
historyStack.Add("State1");
historyStack.Add("State2");
In this example, two states, "State1" and "State2", are added to the history stack.